﻿@model EntriesArchiveViewModel

<div class="archive">
	<ul>
	@foreach (ArchiveInfo archiveInfo in this.Model.ArchiveInfos)
	{
		string url = string.Empty;
		string cssClass = string.Empty;
		if (this.Model.FilterConfig.Month == archiveInfo.Month && this.Model.FilterConfig.Year == archiveInfo.Year)
		{
			url = this.Url.Action("List", "Entries", new { viewType = this.Model.ViewType, pageNumber = 1 });
			cssClass = "currentMonth";
		}
		else
		{
			url = this.Url.Action("Archive", "Entries", new { viewType = this.Model.ViewType, month = archiveInfo.Month, year = archiveInfo.Year });
		}
		<li class="@cssClass">
			<a href="@url">@string.Format("{0} {1} ({2})", this.Html.GetMonthNameByNumber(archiveInfo.Month), archiveInfo.Year, archiveInfo.EntriesCount)</a>
		</li>
	}
	</ul>
</div>